﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Data;

namespace Zatify.API.Controllers
{
    public class BaseCostTimingController : BaseController
    {
        public string GetList(string token)
        {
            try
            {
                DataTable dt = DataAccess.GetDataTable("spAPI_BaseCostTiming_GetList",
                    new string[] { "Token" }, new object[] { token });

                if (Convert.ToInt32(dt.Rows[0]["IdResult"]) == 0)
                    return CommonLib.ErrorXml("Invalid token", "1").ToString();
                else
                    return CommonLib.OkXml(new string[] { "Data" }, new string[] { dt.Rows[0]["Result"].ToString() }).ToString();
            }
            catch (Exception ex)
            {
                return CommonLib.ErrorXml(ex.Message, "100").ToString();
            }
        }
    }
}
